export default {
  namespaced: true,
  state: () => ({
    user: {
      role: 0
    }
  }),
  mutations: {
    setUser(state, user) {
      state.user = user
    },
    clearUser(state) {
      state.user = null
    }
  },
  actions: {

  },
  getters: {
    token: state => {
      return {
        username: state.user.username || '',
        role: state.user.role
      }
    }
  }
}